<?php

class gamesModel extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    function ReadAll() {
        //Lire toutes les games
        $query = $this->db->get('games');
        return $query->result();
    }

    function create($array = null) {
        //Insertion d'une games
        if ($array == null)return false;
        $this->db->insert('games', $array);
    }

    public function update($array = null) {
        //Modification d'une update
        if ($array == null)return false;
        $this->db->where("id_games", $array["id_games"]);
        $query = $tihs->db->update("games", $array);
    }

    public function delete($array = null) {
        //Supression d'une games
        if ($array == null)return false;
        $this->db->where("id_games", $array["id_games"]);
        $query = $this->db->delete("games", $array);
    }

}
